package org.example.B_100;

import java.util.Scanner;

/**
 * @author lihao
 * @className IPv4AddressesConvertedIntegers
 * @date 2023/11/29
 * @description
 * IPv4地址转换成整数
 */
public class IPv4AddressesConvertedIntegers {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println(getResult(sc.nextLine()));
    }

    public static String getResult(String s){
        //分割字符四节为数组
        String[] ip = s.split("#");
        //判断各种异常情况
        if (ip.length != 4){
            return "invalid IP";
        }


        if (!isValid(ip[0],1,128) || isValid(ip[1],0,255) || isValid(ip[2],0,255) || isValid(ip[3],0,255)) {
            return "invalid IP";
        }
        return null;
    }

    //检查约束
    public static boolean isValid(String s,int from ,int to){
        s.matches("");
        return true;
    }


}
